home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 14
/
CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso
/
System
/
CDsupport
/
IDer
/
Routines
/
GetCurrentName.s
< prev
next >
Wrap
Text File
|
1997-02-18
|
1KB
|
78 lines
GetCurrentName: Cmp.W #ARGS_READARG,_ArgMode
Bne.S .NotRDAArgs
Move.L _CurrentName(PC),A0
Move.L (A0)+,D1
Move.L A0,_CurrentName
Tst.L D1
Beq LaunchDone
Move.L D1,_FileName ;so we know what to load
Bra .GotName
.NotRDAArgs
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Cmp.W #ARGS_ASLREQ,_ArgMode
Bne.S .NotASLReq
Move.L _Requestor(PC),A4
Lea FileName,A2
Move.L A2,D1
Move.L fr_Drawer(A4),D2
Move.L #1024,D3
CALL AddPart,DOS
Move.L _CurrentName(PC),A0
Move.L (A0)+,D0 ;wa_Lock
Move.L (A0)+,D2 ;wa_Name
Move.L A0,_CurrentName
Tst.L D2
Beq LaunchDone
Move.L A2,D1
Move.L #1024,D3
CALL AddPart
Move.L A2,_FileName
Bra.S .GotName
.NotASLReq
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Cmp.W #ARGS_ICONS,_ArgMode
Bne LaunchFinished
Move.L _CurrentName(PC),A0
Lea FileName,A2
Move.L (A0)+,D4
Move.L (A0)+,D5
Move.L A0,_CurrentName
Tst.L D5
Bne.S .NameOK
Subq.W #1,_LoopCount
Beq LaunchFinished
Bra GetCurrentName
.NameOK Tst.L D4
Bne.S .LockOK
Subq.W #1,_LoopCount
Beq LaunchFinished
Bra GetCurrentName
.LockOK Move.L D4,D1
Move.L A2,D2
Move.L #1024,D3
CALL NameFromLock,DOS
Move.L A2,D1
Move.L D5,D2
Move.L #1024,D3
CALL AddPart
Move.L A2,_FileName
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
.GotName Move.L _FileName(PC),D1
Move.L D1,_ErrFN1+4 ;for error reporting
Move.L D1,_ErrFN2+4 ;for error reporting
CALL FilePart,DOS ;just get the filename, exclude the path
Move.L D0,_FilePart